package com.fs.iot.task;

import com.fs.iot.service.DeviceEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 设备离线检测任务
 *
 * @author  LiuQi 2025/3/22-20:28
 * @version V1.0
 **/
@Component
public class DeviceOfflineCheckTask {
    @Autowired
    private DeviceEntityService deviceService;

    /**
     * 设备离线检测 ，10s执行一次
     */
    @Scheduled(initialDelay = 10000, fixedDelay = 10000)
    public void check() {
        // 根据模型的离线时长更新设备状态
        deviceService.updateStatusAuto();
    }
}
